<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib prefix="pu" uri="/WEB-INF/tld/pageutil.tld"%>
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt"%>
<c-rt:if test="${!empty param.orderProdId}">
<c-rt:set var="params" value="${pu:addToList('paras', pu:toLong(param.orderProdId))}"/>
<c-rt:set var="hql">
from ServiceOrderProduct where orderProdId=?
</c-rt:set>
<c-rt:set var="serviceOrderProducts" value="${pu:queryByHql(hql, params, null) }"/>
<c-rt:set var="serviceOrder" value="${pu:get('com.yaodian100.ec.order.entity.ServiceOrders', serviceOrderProducts[0].serviceId) }"/>
</c-rt:if>
<c-rt:if test="${empty param.orderProdId}">
<c-rt:set var="serviceOrder" value="${pu:get('com.yaodian100.ec.order.entity.ServiceOrders', question.extraValue['returnId'].value)}"/>
<c-rt:set var="params" value="${pu:addToList('paras', question.extraValue['returnId'].value)}"/>
<c-rt:set var="hql">
from ServiceOrderProduct where serviceId=?
</c-rt:set>
<c-rt:set var="serviceOrderProducts" value="${pu:queryByHql(hql, params, null) }"/>
</c-rt:if>
<c-rt:set var="order" value="${pu:get('com.yaodian100.ec.order.entity.Orders', serviceOrder.orderId)}" />
<div class="d-show"> 
        <ul> 
          <li class="w-1of1"><strong style="padding-left:2.2em;">退货数量：</strong>
          	<c-rt:forEach items="${serviceOrderProducts}" var="orderProduct">
      
<c-rt:set var="isMain" value="false"/>
<c-rt:set var="isPrebuy" value="false"/>
<c-rt:set var="isPresent" value="false"/>
<c-rt:set var="isAddon" value="false"/>
<c-rt:set var="isCampaign" value="false"/>
<c-rt:set var="isQuotafilled" value="false"/>
<c-rt:set var="isCombo" value="false"/>
        		
		<c-rt:forEach items="${orderProduct.serviceOrderDetail}" var="productDetail" varStatus="index">
        		<c-rt:choose>
        			<c-rt:when test="${productDetail.detailTp=='0'}">
        				<c-rt:set var="isMain" value="true"/>
        			</c-rt:when>
        			<c-rt:when test="${productDetail.detailTp=='1'}">
        				<c-rt:set var="isPrebuy" value="true"/>
        			</c-rt:when>
        			<c-rt:when test="${productDetail.detailTp=='2'}">
        				<c-rt:set var="isPresent" value="true"/>
        			</c-rt:when>
        			<c-rt:when test="${productDetail.detailTp=='3'}">
        				<c-rt:set var="isAddon" value="true"/>
        			</c-rt:when>
        			<c-rt:when test="${productDetail.detailTp=='4'}">
        				<c-rt:set var="isCampaign" value="true"/>
        			</c-rt:when>
        			<c-rt:when test="${productDetail.detailTp=='5'}">
        				<c-rt:set var="isQuotafilled" value="true"/>
        			</c-rt:when>
        			<c-rt:when test="${productDetail.detailTp=='6'}">
        				<c-rt:set var="isCombo" value="true"/>
        			</c-rt:when>
        		</c-rt:choose>
        	</c-rt:forEach>       
      
      <table  width="100%" border="1" cellpadding="0" cellspacing="0" class="tb-1"> 
	              <tr> 
	                <th>商品名称</th> 
	                <th width="100">退货数量</th> 
	                <th>退货注意事项</th> 
                  </tr> 
	              <tr> 
	                <td> 
                    	<p>${orderProduct.prodName }</p> 
                          <ul class="t-align-L"> 
                            <c-rt:forEach items="${orderProduct.serviceOrderDetail}" var="productDetail" varStatus="index">
        	<c-rt:if test="${prePD.prodSpecId!=productDetail.prodSpecId && productDetail.detailTp=='2'}">
        	
        	
                            <li><span class="type-2">赠品</span>• ${productDetail.prodName }
                            </li> 
                           <c-rt:set var="prePD" value="${productDetail}"/>
        					</c-rt:if>
                            </c-rt:forEach>
                         </ul> 
                    </td> 
	                <td valign="top">
			<c-rt:set var="productDetailCounts" value="0"/>
        	<c-rt:forEach items="${orderProduct.serviceOrderDetail}" var="productDetailIn">
        	<c-rt:if test="${productDetailIn.detailTp=='0'}">
        	<c-rt:set var="productDetailCounts" value="${pu:toInteger(productDetailCounts)+1}"/>
        	</c-rt:if>
        	</c-rt:forEach>
	          ${productDetailCounts }
          <c-rt:set var="prePD" value="${null}"/>
<br /></td> 
	                <td valign="top"><p class="txt-rd">同一商品仅有一次退货机会。</p> 
                  <p class="txt-gy">（例：同一商品购买5件，退2件后，剩餘3件将
                 	 无法再申请退、换货。）</p> 
                    <c-rt:if test="${isPresent}"><p class="txt-rd">办理退货时，请务必连同所有赠品一起寄回。</p></c-rt:if></td> 
                  </tr> 
                  <c-rt:if test="${isAddon}">
	              <tr> 
	                <td><p><span class="type-3">加购</span>
	        <c-rt:forEach items="${orderProduct.serviceOrderDetail}" var="productDetail" varStatus="index">
	        <c-rt:if test="${productDetail.detailTp=='3'}">
        	
        	
        	<c-rt:set var="productDetailCounts" value="0"/>
        	<c-rt:forEach items="${orderProduct.serviceOrderDetail}" var="productDetailIn">
        	<c-rt:if test="${productDetailIn.detailTp=='3'}">
        	<c-rt:set var="productDetailCounts" value="${pu:toInteger(productDetailCounts)+1}"/>
        	</c-rt:if>
        	</c-rt:forEach>
	         
			${productDetail.prodName } 
			<c-rt:set var="prePD" value="${productDetail}"/>
			</c-rt:if>
			
			</c-rt:forEach>
	                </p></td> 
	                <td valign="top">

${productDetailCounts }

<br /></td> 
	                
	                <td valign="top"><p class="txt-rd">若要退主商品，需连同加购商品一起办理退货。</p></td> 
	                
                  </tr>
                  </c-rt:if> 
                  <c-rt:if test="${!empty param.orderProdId}">
                  <tr> 
	                <td><p><span class="type-5">满额购</span>

<c-rt:forEach items="${orderProduct.serviceOrderDetail}" var="productDetail" varStatus="index">
        	
        	<c-rt:if test="${productDetail.detailTp=='5'}">
        	<c-rt:set var="productDetailCounts" value="0"/>
        	<c-rt:forEach items="${orderProduct.serviceOrderDetail}" var="productDetailIn">
        	<c-rt:if test="${productDetailIn.detailTp=='5'}">
        	<c-rt:set var="productDetailCounts" value="${pu:toInteger(productDetailCounts)+1}"/>
        	</c-rt:if>
        	</c-rt:forEach>
			${productDetail.prodName }
			</c-rt:if>
			
			</c-rt:forEach>
			
</p></td> 
	                <td valign="top">

${productDetailCounts }

<br /></td> 
	                <td valign="top"><p class="txt-rd">满额购商品已不符合满额购优惠标準，需连同退货商品一同办理退货。  </p></td> 
                  </tr> 
                  </c-rt:if>
              </table> 
	 		   <!-- 類型3 -->
	 		   </c-rt:forEach>    
          </li> 
          <li class="w-1of1"><strong style="padding-left:2em;">退货原因：</strong>${serviceOrder.reason }</li> 
          <li class="w-1of1"><strong>退货问题描述：</strong>${serviceOrder.description }</li> 
          <li class="w-1of1"><strong>配件贈品狀態：</strong>${serviceOrder.accessaryDescription }</li> 
        </ul> 
      </div> 
      <!-- 聯絡資訊 --> 
      <h3>联络信息</h3> 
      <div class="d-show"> 
        <ul> 
          <li class="w-1of1"><strong style="padding-left:2em;">姓名：</strong>${serviceOrder.receiverName }</li> 
          <li class="w-1of1"><strong>手机号码：</strong>${serviceOrder.receiverMobile }</li> 
          <li class="w-1of1"><strong>固定電話：</strong>${serviceOrder.receiverPhoneArea }-${serviceOrder.receiverPhone }   分机${serviceOrder.receiverExt } </li> 
          <li class="w-1of1"> 
            <div><strong>联络地址：</strong></div> 
            <div>${serviceOrder.receiverProvince }，${serviceOrder.receiverCity }，${serviceOrder.receiverArea }，${serviceOrder.receiverAddr }，${serviceOrder.receiverZip } </div> 
          </li> 
        </ul> 
      </div> 
      <!-- 聯絡資訊 --> 
      <!-- 退款方式 --> 
      <h3>退款方式</h3> 
      <div class="d-show"> 
        <ul> 
          <li class="w-1of1">￥${serviceOrder.returnMyWallet }退至“我的账户余额” <br /> 
            ￥${serviceOrder.returnCash+serviceOrder.returnInstallmentFee }退至第三方支付平台<br /> 
    <c-rt:if test = "${not empty order.orderBonusCampaign}">${serviceOrder.returnBonus*order.orderBonusCampaign.offsetRate}</c-rt:if><c-rt:if test = "${empty order.orderBonusCampaign}">0</c-rt:if>退至“积分”帐户</li> 
          <li class="w-1of1">．您透过网上支付方式付至耀点100的款项，退款将退至您的原支付卡帐户中。 </li> 
          <li class="w-1of1"> ．您通过货到付款、银行转账或邮局汇款等方式付至耀点100的款项，退款将退至您的耀点100我的账户余额中。</li> 
        </ul> 
      </div> 
      <!-- 退款方式 --> 